<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>
  <article>
  <div class="left-box">
    <div class="whitebg">
      <div class="news-title">






        <span class="weizhi">
        <!-- 管理员操作 -->
          <?php if(!empty($user)){ if($user['groupname'] == '管理员组'){ ?>
        <a href="/?post-update-<?php echo thread_read($tid)['firstpid'];  ?>">[编辑]</a>&nbsp;&nbsp;
        <a href="javascript:;"  id="top"><?php if($thread['top'] == 1) echo '[取消置顶]'; else  echo '[置顶]'; ?></a>&nbsp;&nbsp;
        <a href="javascript:;" id="del">[删除]</a>
        <?php }} ?>
        <!-- 管理员操作 end -->



       </span>




      <!--  板块名称 -->
        <h2><a href="/category-<?php echo $fid;    ?>" >
          <?php echo $forum['name'];  ?></a>
       <!-- 帖子分类 -->
       <?php if(!empty($thread['tagids'])) echo create_tag_url($fid,$thread['tagids']); ?>
       <!-- 帖子分类 end-->
        </h2>
      <!--  板块名称 end-->


      </div>
      <div class="newstext-box">
        <h1 class="news-title-h1"><?php echo $thread['subject'];   ?></h1>
        <div class="keywords">
        <?php if(!empty($tid)) echo get_fenci_tag($tid);   ?>
       </div>
        <div class="picview-other">
          <span class="po-date"><?php echo date("Y-m-d",$thread['create_date']); ?></span>
          <span class="po-classname"><?php echo $forum['name'];  ?></span>
          <span class="po-view"><?php echo $thread['views']; ?></span> </div>
        <!-- <div class="smalltext"><i></i><?php echo $forum['announcement']  ?></div> -->
        <div class="newstext"  id="container">
            <?php echo $first['message_fmt'];?>

        </div>
       <!--  附件下载 -->
       <?php if(!empty($first['filelist'])){ ?>
       <fieldset class="layui-elem-field">
        <legend>附件下载</legend>
        <div class="layui-field-box">
                <?php foreach($first['filelist'] as $file){ ?>
                <div class="down-view">
                  <h1 class="news-title-h1"><?php echo $file['orgfilename'];  ?></h1>
                <span class="down-info">
                  文件大小：<em><font color="green"><?php echo  round($file['filesize'] / 1024,2) ;  ?>KB</font></em>
                  所需金币：<em><font color="orange"><?php echo $file['golds'];  ?></font></em>
                  剩余金币：<em><font color="red"><?php if(empty($user)) echo '<a href="/user-login.htm">登录后查看</a>' ;else echo $user['golds'];  ?></font></em>
                  最后更新时间：<em><font color="blue"><?php echo $file['create_date_fmt'];  ?></font></em>
                </span>
                <span class="btn-blue"><a href="/attach-download-<?php echo $file['aid'];  ?>.htm">立即下载</a></span>
              </div>
             <?php } ?>
        </div>
      </fieldset>
      <?php } ?>

<!--         <div class="diggit"><a href="JavaScript:makeRequest('/e/public/digg/?classid=2&id=2&dotop=1&doajax=1&ajaxarea=diggnum','EchoReturnedText','GET','');"> 点赞 </a>(<b id="diggnum">12</b>)</div> -->
        <div class="clear"></div>

        <blockquote class="layui-elem-quote">
          <p>转载请说明来源于"柒微博客"</p>
          <p>本文地址：<a href="/article-<?php echo $thread['tid'];   ?>.html" >http://7we.net/article-<?php echo $thread['tid'];   ?>.html</a></p>
        </blockquote>
<hr class="layui-bg-orange">

        <div class="clear"></div>
        <div class="info-pre-next">
          <ul>
          <?php if(!empty($lastthread)){ ?>
            <li>
              <a href="/article-<?php  echo $lastthread['tid']  ?>.html"><i><em>上一篇</em>
              <img src="<?php  echo $last_img;  ?>"></i>
              <h2><?php  echo $lastthread['subject']  ?></h2>
              <p><?php $message=post__read($lastthread['firstpid'])['message']; echo xn_substr(strip_tags($message),0,90);   ?>
              </p>
              </a>
            </li>
          <?php } ?>

          <?php if(!empty($nextthread)){ ?>
            <li>
              <a href="/article-<?php  echo $nextthread['tid']  ?>.html">
                <i><em>下一篇</em><img src="<?php  echo $next_img;  ?>"></i>
                <h2><?php  echo $nextthread['subject']  ?></h2>
                <p><?php $message=post__read($nextthread['firstpid'])['message']; echo xn_substr(strip_tags($message),0,90);   ?></p>
              </a>
            </li>
          <?php } ?>

          </ul>
        </div>
      </div>
    </div>
    <div class="clear blank"></div>
    <div class="otherlink whitebg">
      <div class="news-title">
        <h2>相关文章</h2>
      </div>
      <ul>
       <?php  foreach($viewsthread as $views) { ?>
        <li>
          <i></i>
          <a href="/article-<?php echo $views['tid'];  ?>.html" title="<?php echo $views['subject'];  ?>" ><?php echo $views['subject'];  ?></a>
        </li>
         <?php } ?>
       </ul>
    </div>
    <div class="ad ad-big"><a href='#' target=_blank><img src='http://menhu.yangqq.com/d/file/p/2019/05-11/82c0a8be75a4fa8d152cae2cdc05d1c4.jpg' border=0 width='830' height='140' alt=''></a></div>
    <div class="pinglun-box whitebg">
      <div class="news-title">
        <h2>文章评论</h2>
      </div>
<!-- 评论 开始 -->
<div class="pinglun">

<div class="pl-520am" data-id="2" data-classid="2" data-showhot="0"></div>
<textarea id="layeditDemo" style="display: none;"> </textarea>
    <div style="text-align: right;margin-top: 10px;height: 30px">
      <?php if(empty($user)){  ?>
      <span style="text-align:center;">请您先<a href="/user-login" style="color: blue">登录|注册</a>后再进行回复</span>
      <?php }else{  ?>
      <button type="button" class="layui-btn layui-btn-orange" id="btn">发表回复</button>
      <?php }  ?>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="text-align: center;"><legend>回复区</legend></fieldset>
<!-- 回复区 -->
<div id="huifu">

  <?php if($postlist) { foreach($postlist as $_post) { ?>
  <div>
    <div class="layui-row">
      <div class="layui-col-md1 layui-col-xs2"><img src="https://thirdqq.qlogo.cn/g?b=oidb&k=Vrbb8TOZI3I3XLTEasqFrQ&s=100&t=1557457902" height="45px" width="45px"></div>
      <div class="layui-col-md4 layui-col-xs8">
          <div class="layui-row" style="color: blue"><?php echo $_post['username'];?></div>
          <div class="layui-row" style="margin-top: 4px;color:rgb(207, 217, 217)">
            [<?php echo $_post['floor'];?>楼] <?php echo $_post['create_date_fmt'];?>
            </div>
      </div>
    </div>
    <div class="layui-row" style="margin-top: 15px"><?php echo $_post['message'];?></div>
    <div class="layui-row" style="margin-top: 5px;color:rgb(207, 217, 217);text-align:right;">
      <i class="layui-icon">&#xe609; 这是一个非常没有个性的个性签</i>
    </div>
    <hr class="layui-bg-orange">
  </div>
  <?php }} ?>

</div>

<!-- 回复区 end-->

</div>

<!-- 评论 结束 -->

    </div>
  </div>

<!-- 右侧 -->
<?php include _include(APP_PATH.'plugin/di_blogs/html/right.inc.htm'); ?>

</article>
<div class="clear blank"></div>
<?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>
<script type="text/javascript">
    jQuery(document).ready(function($){
    //side-tab
     $('.side-tab #sidetab li').click(function(){
     $(this).addClass('sidetab-current').siblings().removeClass('sidetab-current');
     $('#sidetab-content>section:eq('+$(this).index()+')').show().siblings().hide();
      });
  });
</script>

<script type="text/javascript">
$(document).ready(function() {
  $('pre').each(function(i, e) {hljs.highlightBlock(e)});
});
</script>

<script src="plugin/di_blogs/overwrite/view/layui/layui.js"></script>
<!-- 置顶 -->
<script type="text/javascript">
  layui.use(['form','layer'], function(){
    var form = layui.form;
    var layer = layui.layer;

    //置顶
    $("#top").click(function(){
      layer.load();
     $.post("/?blogsapi",{type:'top',tid:<?php   echo $tid;?>},function(res){
      layer.closeAll();
          layer.msg(res.message);
           if(res.code == 0){
            $("#top").text('[取消置顶]');
           }
           if(res.code == -1){
            $("#top").text('[置顶]');
           }

       },"JSON");
    });

    //置顶
    $("#del").click(function(){
      layer.load();
     $.post("/?blogsapi",{type:'del',tid:<?php   echo $tid;?>},function(res){
      layer.closeAll();

           if(res.code == 0){
            layer.msg('成功,即将跳转');
            window.location.href=res.message;
           }
           if(res.code != 0){
            layer.msg(res.message);
           }

       },"JSON");
    });


  });
</script>

<!-- 评论回复 -->
  <script>
  layui.use(['form','layer','layedit'], function(){
    var form = layui.form;
    var layer = layui.layer;
    var layedit = layui.layedit;
//编辑器
        layedit.set({
                //暴露layupload参数设置接口 --详细查看layupload参数说明
                uploadImage: {
                    url: '/Attachment/LayUploadFile',
                    accept: 'image',
                    acceptMime: 'image/*',
                    exts: 'jpg|png|gif|bmp|jpeg',
                    size: '10240'
                }
                , uploadVideo: {
                    url: '/Attachment/LayUploadFile',
                    accept: 'video',
                    acceptMime: 'video/*',
                    exts: 'mp4|flv|avi|rm|rmvb',
                    size: '20480'
                }
                //右键删除图片/视频时的回调参数，post到后台删除服务器文件等操作，
                //传递参数：
                //图片： imgpath --图片路径
                //视频： filepath --视频路径 imgpath --封面路径
                , calldel: {
                    url: '/Attachment/DeleteFile'
                }
                //开发者模式 --默认为false
                , devmode: true
                //插入代码设置
                , codeConfig: {
                    hide: true,  //是否显示编码语言选择框
                    default: 'javascript' //hide为true时的默认语言格式
                }
                , tool: [
                     'code', 'strong', 'del', 'addhr', '|', 'fontFomatt', 'colorpicker'
                    , '|',  'link','face'
                    , '|','table', 'fullScreen'
                ]
                , height: '90%'
            });

      index=layedit.build('layeditDemo', {
      height: 150 //设置编辑器高度
      });

//回复
    $("#btn").click(function(){
     var data={
      message:layedit.getContent(index),
      return_html:0,
      quotepid:0,
      doctype:1,
     };
     $.post('/<?php echo url("post-create-$tid-1");?>',data,function(res){
           if(res.code == 0){
             layer.msg('回复成功');
             var html ='';
             html+='<div>';
             html+='<div class="layui-row">';
             html+='<div class="layui-col-md1 layui-col-xs2"><img src="<?php  if(!empty($user)) echo $user["avatar_url"];    ?>" height="45px" width="45px"></div>';
             html+='<div class="layui-col-md4 layui-col-xs8" style="float: left ">';
             html+='<div class="layui-row" style="color: blue"><?php if(!empty($user)) echo $user["username"];    ?></div>';
             html+='<div class="layui-row" style="margin-top: 4px;color:rgb(207, 217, 217)">1秒前</div>';
             html+='</div>';
             html+='</div>';
             html+='<div class="layui-row" style="margin-top: 15px">'+layedit.getContent(index)+'</div>';
             html+='<div class="layui-row" style="margin-top: 1px;color:rgb(207, 217, 217);text-align:right;">';
             html+='<i class="layui-icon">&#xe609; 这是一个没有个性的个性签名</i>';
             html+='</div>';
             html+='<hr class="layui-bg-orange">';
             html+='</div>';
            $('#huifu').after(html);
           }else{
            layer.msg(res.message);
           }
       },"JSON");
    });


  });
  </script>
<script src="https://my.openwrite.cn/js/readmore.js" type="text/javascript"></script>
<script>
    const btw = new BTWPlugin();
    btw.init({
        id: 'container',
        blogId: '20457-1583689488743-343',
        name: '猿在江湖',
        qrcode: 'http://cdn.7we.net/qrcode_for_gh_a0e7cb9c35be_258.jpg',
        keyword: 'yuan',
    });
</script>